<template>
         <div>
        <van-checkbox-group v-model="checked">
            <van-checkbox  v-model="checked" v-for="item in mockList" :key="item.id">
                <van-card
                    :num="item.skuName"
                    :price="item.skuPrice"
                    desc="描述信息1"
                    :title="item.skuName"
                    :thumb="item.imgUrl"
                />
            </van-checkbox>
        </van-checkbox-group>
        <div class="submit_1">
          <van-submit-bar :price="3050" button-text="提交订单">
            <van-checkbox v-model="checked">全选</van-checkbox>
              <template #tip>
                累计共<span>{{222 }}</span>件商品,可点击 <van-button
                
                type="primary" size="small">编辑</van-button> 按钮进行商品数量的修改
              </template>
          </van-submit-bar>
        </div>
        
    </div>
</template>

<script setup lang='ts'>
    import { onMounted, ref } from 'vue';
    import api from '@/api/home'
    //定义复选框
    const checked = ref(['a', 'b']);
    const mockList = ref()

    const getMocklist = async () =>{
        try {
            let result = await api.reqFloor()
            mockList.value = result.data[0].cartInfoList            
        } catch (error) {
            console.log(error);
            
        }
    }
    onMounted(()=>{
        getMocklist()
    })
</script>

<style scoped>
    
</style>
